package aidturith.files.mp3;

import java.io.File;
import java.io.IOException;

import aidturith.files.ProcessFile;

public class Mp3Tagger {

	public static void main(String[] args) {
		// http://id3.org/id3v2.4.0-frames
		// https://github.com/mpatric/mp3agic
		try {
			ProcessFile fileProcessor = new ProcessFile("C:\\Users\\admin\\Music");
			int i = 0;
			for(File f : fileProcessor.getList()) {
				Mp3File mp3file = new Mp3File(f.getAbsolutePath());
				if (mp3file.hasId3v2Tag()) {
					//for(ID3v2FrameSet frame : mp3file.getId3v2Tag().getFrameSets().values())
					//System.out.println(frame);
					ID3v2 tag = mp3file.getId3v2Tag();
					System.out.println("Track: " + tag.getBMP());
				}
				//if(i == 0) break;
				i++;
			}
		} catch (IOException e) {
			e.printStackTrace();
		} catch (UnsupportedTagException e) {
			e.printStackTrace();
		} catch (InvalidDataException e) {
			e.printStackTrace();
		}
	}

}
